package com.gmako.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.web.servlet.mvc.multiaction.MultiActionController;

/**
 * 公共Controller
 * 
 * @author Warlock叶
 */
public class BaseController extends MultiActionController {

	/**
	 * 判断后台管理员是否登录
	 * 
	 * @author Warlock叶
	 * @param request
	 * @return
	 */
	public void managerLoginIs(HttpServletRequest request,
			HttpServletResponse response) throws IOException, ServletException {
		if (request.getSession().getAttribute("STATUser") == null) {
			response.sendRedirect("/admin/Manage_login.jsp");
		} else {

		}
	}

	/**
	 * 向下传值
	 * 
	 * @author Warlock
	 * @param key
	 * @param request
	 */
	public void passVal(String key, HttpServletRequest request) {
		String val = request.getParameter(key);
		request.setAttribute(key, val);
	}

}
